<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<title>Simple example</title>
<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
	// Notice: The simple theme does not use all options some of them are limited to the advanced theme
	tinyMCE.init({
		mode : "textareas",
		theme : "simple"
	});
</script>
<script language="javascript" type="text/javascript"> 

function AdContentToEditor(){

var InputField = document.getElementById("InputField");
var ValueInput = InputField.value;

tinyMCE.setContent(ValueInput);
tinyMCE.execCommand('Bold');
}
function TakeContentFromEditor(){
var TinyId = document.getElementById("elm2");
var OutputFieldId = document.getElementById("OutputField");
OutputFieldId.value = tinyMCE.getContent();
}
function ExecuteCommand(){
var TinyId = document.getElementById("elm2");
tinyMCE.execInstanceCommand("elm2", "mceFocus");
//tinyMCE.execCommand('mceAddControl', false, 'elm2'
//tinyMCE.execCommand('mceFocus',false,'elm2');
}

</script>
<!-- /tinyMCE -->

</head>
<body>	
<input type="button" VALUE ='AdContentToEditor' ONCLICK="AdContentToEditor()"> <br>
<input id='InputField' type="text" VALUE ='test'> <br>
<input type="button" VALUE ='AdContentToEditor' ONCLICK="TakeContentFromEditor()"> <br>
<input id='OutputField' type="text"  <br>
<input type="button" VALUE ='ModContent' ONCLICK="TakeContentFromEditor()"> <br>
<input type="button" VALUE ='ExecuteCommand' ONCLICK="ExecuteCommand()"> <br>
<a href="#" onclick="tinyMCE.execCommand('Bold');return false;">[Bold]</a>

<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<br />
<textarea id="elm2" name="elm2" rows="15" cols="32">
	Some &lt;b&gt;element&lt;/b&gt;, this is to be editor 2.
	&lt;p&gt;Some paragraph. &lt;a href=&quot;http://www.sourceforge.net&quot;&gt;Some link&lt;/a&gt;&lt;/p&gt;
	&lt;img src=&quot;logo.jpg&quot;&gt;
</textarea>
<br />
	<input type="submit" name="save" value="Submit" />
	<input type="reset" name="reset" value="Reset" />
</form>
</body>
</html>